package com.itheima.servlet;

import com.itheima.service.AnnotationHouseService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 测试spring 常用注解
 */
public class SpringAnnotation {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean_annotation.xml");
        AnnotationHouseService houseService1 = applicationContext.getBean("houseService", AnnotationHouseService.class);
        AnnotationHouseService houseService2 = applicationContext.getBean("houseService", AnnotationHouseService.class);
        System.out.println(houseService1);
        System.out.println(houseService2);
        //        houseService.saveHouse();

//        AnnotationHouseDao houseDao = applicationContext.getBean("houseDao", AnnotationHouseDao.class);
//        houseDao.saveHouse();

    }
}
